const express = require('express')
const expressJoi = require('@escook/express-joi')
const artcate_handler = require('../router_handler/artcate.js')
const { add_cate_schema } = require('../schema/artcate')
const { delete_cate_schema, get_cate_schema,update_cate_schema} = require('../schema/artcate')

const router = express.Router()

router.get('/cates', artcate_handler.getArticleCates)

router.post('/addcates',artcate_handler.addArticleCates)

router.post('/addcates', expressJoi(add_cate_schema), artcate_handler.addArticleCates)

router.get('/deletecates/:id', expressJoi(delete_cate_schema), artcate_handler.deleteArticleCates)

router.get('/cates/:id',expressJoi(get_cate_schema), artcate_handler.getArtCateById)

router.post('/updatecate', expressJoi(update_cate_schema),artcate_handler.updateCateById)

module.exports = router